<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function ajax(options) {
            var x = new XMLHttpRequest();
            x.open(options.type, options.url);
            x.send();
            x.onload = function() {
                console.log(x.responseText);
            }
        }
        ajax({
            type: 'get',
            url: 'http://127.0.0.1:8000/cors'
        })
    </script>
</body>

</html>